<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="reference">
<meta name="DC.Title" content="auto_partitioner Class">
<meta name="DC.subject" content="auto_partitioner Class">
<meta name="keywords" content="auto_partitioner Class">
<meta name="DC.Relation" scheme="URI" content="../../../reference/algorithms/partitioners.htm">
<meta name="DC.Relation" scheme="URI" content="../../task_scheduler/task_scheduler_init_cls.htm#task_scheduler_init_cls">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="auto_partitioner_cls">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../../intel_css_styles.css">
<title>auto_partitioner Class</title>
<xml>
<MSHelp:Attr Name="DocSet" Value="Intel"></MSHelp:Attr>
<MSHelp:Attr Name="Locale" Value="kbEnglish"></MSHelp:Attr>
<MSHelp:Attr Name="TopicType" Value="kbReference"></MSHelp:Attr>
</xml>
</head>
<body id="auto_partitioner_cls">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(3);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="auto_partitioner_cls"><!-- --></a>

 
  <h1 class="topictitle1">auto_partitioner Class</h1>
 
   
  <div> 
	 <div class="section"><h2 class="sectiontitle">Summary</h2> 
		 
		<p> Specify that a parallel loop should optimize its range subdivision
		  based on work-stealing events. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Header</h2> 
		 
		<pre>#include "tbb/partitioner.h"</pre> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Syntax</h2> 
		 
		<pre>class auto_partitioner;</pre> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Description</h2> 
		 
		<p>A loop template with an 
		  <samp class="codeph">auto_partitioner</samp> attempts to minimize range splitting
		  while providing ample opportunities for work-stealing. 
		</p>
 
		<p>The range subdivision is initially limited to S subranges, where S is
		  proportional to the number of threads specified by the 
		  <samp class="codeph">task_scheduler_init</samp>. Each of these subranges is not
		  divided further unless it is stolen by an idle thread. If stolen, it is further
		  subdivided to create additional subranges. Thus a loop template with an 
		  <samp class="codeph">auto_partitioner</samp> creates additional subranges only
		  when necessary to balance load. 
		</p>
 
		<div class="Note"><h3 class="NoteTipHead">
					Tip</h3> 
		  <p> When using 
			 <samp class="codeph">auto_partitioner</samp> and a 
			 <samp class="codeph">blocked_range</samp> for a parallel loop, the body may be
			 passed a subrange larger than the 
			 <samp class="codeph">blocked_range</samp>'s grainsize. Therefore do not assume
			 that the grainsize is an upper bound on the size of the subrange. Use a<samp class="codeph">
				simple_partitioner</samp> if an upper bound is required. 
		  </p>
 
		</div> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Members</h2> 
		 
		<pre> 
namespace tbb {
    class auto_partitioner {
    public:
        auto_partitioner();
        ~auto_partitioner();
    }
}
</pre> 
		
<div class="tablenoborder"><table cellpadding="4" summary="" frame="border" border="1" cellspacing="0" rules="all"><span class="tabledesc">The following table provides additional information on the
			 members of this template class. 
		  </span><thead align="left"> 
				<tr> 
				  <th class="cellrowborder" valign="top" width="33.89830508474576%" id="d10004e113">Member 
				  </th>
 
				  <th class="cellrowborder" valign="top" width="66.10169491525423%" id="d10004e116">Description 
				  </th>
 
				</tr>
</thead>
 
			 <tbody> 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d10004e113 "><span class="keyword">auto_partitioner()</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d10004e116 "> 
					 <p> Construct an 
						<samp class="codeph">auto_partitioner</samp>. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d10004e113 "><span class="keyword">~auto_partitioner()</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d10004e116 "> 
					 <p>Destroy this 
						<samp class="codeph">auto_partitioner</samp>. 
					 </p>
 
				  </td>
 
				</tr>
 
			 </tbody>
 
		  </table>
</div>
 
	 </div>
 
  </div>
 
  
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../../reference/algorithms/partitioners.htm">Partitioners</a></div>
</div>
<div class="See Also">
<h2>See Also</h2>
<div class="linklist">
<div><a href="../../task_scheduler/task_scheduler_init_cls.htm#task_scheduler_init_cls">task_scheduler_init Class
		  </a></div></div>
</div> 

</body>
</html>
